package org.wj.arithmetic

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object FlatMap extends App {

  val conf = new SparkConf().setMaster("local").setAppName(this.getClass.getName)

  val sc = new SparkContext(conf)

  private val rdd: RDD[String] = sc.parallelize(Array("1,2,3,4", "5,6,7,8,9", "10,11,12"))

  rdd.flatMap(_.split(",")).foreach(println(_))

}
